<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>冒泡排序</title>
</head>

<body>
  <span class="qw">1</span>
  <span class="qw">2</span>
  <script>
    const sa = document.getElementsByTagName('span')[1]
    sa.onclick = function () {
      document.body.style.backgroundColor = 'pink'
    }
  </script>
</body>

</html>